package k2_oop.p9_collection.demo01;

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Queue;

public class UseQueue {
    public static void main(String[] args) {

        Queue<String> singleQueue = new ArrayDeque<>();
        singleQueue.add("hello");
        singleQueue.add("world");
        singleQueue.add("!!!");

        System.out.println(singleQueue);

        Deque<String> doubleQueue = new ArrayDeque<>();
        doubleQueue.add("hello");
        doubleQueue.add("world");
        doubleQueue.add("!");
        doubleQueue.addFirst("你好");
        doubleQueue.offerFirst("今天天气不错");
        doubleQueue.addLast("===");
        doubleQueue.offerLast("???");
        System.out.println(doubleQueue);
    }
}
